/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cliente;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import sop_rmi.Int_Canciones;
import sop_rmi.Int_Usuarios;

/**
 *
 * @author Juma
 */
public class Inter_Admin extends javax.swing.JFrame {

    static String []args;
   
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    String sesion;           //almacena el login del usuario logeado, este dato es necesrio
    int op=0;
    int s=0;
    Usuario_Impl usuario = new Usuario_Impl();
    Usuario_Impl temp = new Usuario_Impl();
    ArrayList<Cancion_Impl> canciones= new ArrayList();
    Cancion_Impl cancion=new Cancion_Impl();
    Lista_Impl lista=new Lista_Impl();
    String nom,apellido,num_ide,login,pass,tipo;
       
    ////////servidor de usuarios /////////
        Int_Usuarios int_user;      
    ////////servidor de canciones//////////
        Int_Canciones int_canciones;
   
        
    public Inter_Admin(String[] arg,Usuario_Impl usuario) throws NotBoundException, MalformedURLException, RemoteException {
        initComponents();
        args=arg;
        sesion=usuario.getLogin();
        ////////servidor de usuarios /////////
        int_user= (Int_Usuarios)Naming.lookup((new StringBuilder()).append("rmi://").append(args[0]).append(":").append(args[1]).append("/usu").toString());
        
        ////////servidor de canciones//////////
        int_canciones= (Int_Canciones)Naming.lookup((new StringBuilder()).append("rmi://").append(args[0]).append(":").append(args[1]).append("/can").toString());
        jLabel5.setText("Sesion iniciada cono :  "+usuario.getNombre()+" "+usuario.getApellido()+"                        Tipo :  "+usuario.getTipo());
        this.setVisible(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel3 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel28 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtfield_caja_buscar = new javax.swing.JTextField();
        jToggleButton1 = new javax.swing.JToggleButton();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        lb_nom_buscar = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        lb_apell_buscar = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        lb_login_buscar = new javax.swing.JLabel();
        lb_num_id_buscar = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        lb_tipo_buscar = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jToggleButton2 = new javax.swing.JToggleButton();
        jPanel4 = new javax.swing.JPanel();
        lb_login_edit = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        txtfield_caja_editar = new javax.swing.JTextField();
        lb_num_id_edit = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        lb_tipo_edit = new javax.swing.JLabel();
        lb_apell_edit = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jToggleButton3 = new javax.swing.JToggleButton();
        lb_nom_edit = new javax.swing.JLabel();
        jToggleButton4 = new javax.swing.JToggleButton();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        txtfield_nom_edit = new javax.swing.JTextField();
        txtfield_pass_edit = new javax.swing.JTextField();
        txtfield_tipo_edit = new javax.swing.JTextField();
        txtfield_num_id_edit = new javax.swing.JTextField();
        txtfield_apell_edit = new javax.swing.JTextField();
        btn_editar = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        lb_apell_del = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        lb_tipo_del = new javax.swing.JLabel();
        lb_nom_del = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jToggleButton5 = new javax.swing.JToggleButton();
        lb_login_del = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        txtfield_caja_del = new javax.swing.JTextField();
        lb_num_id_del = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        jToggleButton6 = new javax.swing.JToggleButton();
        btn_eliminar = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jLabel47 = new javax.swing.JLabel();
        jLabel48 = new javax.swing.JLabel();
        txtfield_caja_del_lista = new javax.swing.JTextField();
        btn_eliminar_lista = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jTabbedPane1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTabbedPane1MouseClicked(evt);
            }
        });

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre", "Apellido", "Login", "Numero de identificacion", "Tipo"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTable1);

        jLabel28.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel28.setText("Listado de Usuarios en el Sistema");

        jButton3.setText("Listar Usuarios");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton1.setText("Salir");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 641, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                            .addComponent(jButton3)
                            .addGap(18, 18, 18)
                            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addComponent(jLabel28, javax.swing.GroupLayout.Alignment.LEADING)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel28)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton3)
                    .addComponent(jButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 399, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Lista de Usuario", jPanel1);

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        jLabel1.setText("Buscar Usuairo");

        jLabel2.setText("Digite el Login del Usuario");

        txtfield_caja_buscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtfield_caja_buscarActionPerformed(evt);
            }
        });

        jToggleButton1.setText("Buscar");
        jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton1ActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel3.setText("Descripcion del Usuario");

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel4.setText("Nombre:");

        lb_nom_buscar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        lb_nom_buscar.setText("---------------------------------------------");

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel6.setText("Apellido:");

        lb_apell_buscar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        lb_apell_buscar.setText("--------------------------------------------");

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel8.setText("Login:");

        lb_login_buscar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        lb_login_buscar.setText("--------------------------------------------");

        lb_num_id_buscar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        lb_num_id_buscar.setText("--------------------------------------------");

        jLabel11.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel11.setText("Numero de Identificacion");

        lb_tipo_buscar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        lb_tipo_buscar.setText("--------------------------------------------");

        jLabel13.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel13.setText("Tipo");

        jToggleButton2.setText("Salir");
        jToggleButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel1)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtfield_caja_buscar, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jToggleButton1))))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(67, 67, 67)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                                    .addComponent(jLabel13)
                                    .addGap(18, 18, 18)
                                    .addComponent(lb_tipo_buscar))
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addComponent(jLabel11)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(lb_num_id_buscar))
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel6)
                                            .addComponent(jLabel4))
                                        .addGap(27, 27, 27)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lb_apell_buscar)
                                            .addComponent(lb_nom_buscar)
                                            .addComponent(lb_login_buscar))))))))
                .addContainerGap(169, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jToggleButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(52, 52, 52))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(jLabel1)
                .addGap(39, 39, 39)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txtfield_caja_buscar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jToggleButton1))
                .addGap(40, 40, 40)
                .addComponent(jLabel3)
                .addGap(30, 30, 30)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(lb_nom_buscar))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(lb_apell_buscar))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(lb_login_buscar))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(lb_num_id_buscar))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(lb_tipo_buscar))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
                .addComponent(jToggleButton2)
                .addGap(40, 40, 40))
        );

        jTabbedPane1.addTab("Buscar Usuario", jPanel2);

        lb_login_edit.setText("--------------------------------------------");

        jLabel15.setText("Login:");

        jLabel16.setText("Numero de Identificacion:");

        txtfield_caja_editar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtfield_caja_editarActionPerformed(evt);
            }
        });

        lb_num_id_edit.setText("--------------------------------------------");

        jLabel18.setText("Digite el Login del Usuario");

        jLabel19.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        jLabel19.setText("Editar Usuairo");

        jLabel20.setText("Apellido:");

        lb_tipo_edit.setText("--------------------------------------------");

        lb_apell_edit.setText("--------------------------------------------");

        jLabel23.setText("Tipo:");

        jLabel24.setText("Nombre:");

        jToggleButton3.setText("Salir");
        jToggleButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton3ActionPerformed(evt);
            }
        });

        lb_nom_edit.setText("---------------------------------------------");

        jToggleButton4.setText("Buscar");
        jToggleButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton4ActionPerformed(evt);
            }
        });

        jLabel26.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel26.setText("Descripcion del Usuario");

        jLabel27.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel27.setText("Digite los Nuevos Campos del Usuario");

        jLabel29.setText("Numero de Identificacion:");

        jLabel30.setText("Apellido:");

        jLabel32.setText("Nombre:");

        jLabel36.setText("Tipo:");

        jLabel37.setText("Password:");

        txtfield_nom_edit.setEnabled(false);

        txtfield_pass_edit.setEnabled(false);

        txtfield_tipo_edit.setEnabled(false);

        txtfield_num_id_edit.setEnabled(false);
        txtfield_num_id_edit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtfield_num_id_editActionPerformed(evt);
            }
        });

        txtfield_apell_edit.setEnabled(false);

        btn_editar.setText("Guardar y Actualizar");
        btn_editar.setEnabled(false);
        btn_editar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_editarActionPerformed(evt);
            }
        });

        jButton2.setText("Cancelar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(btn_editar)
                .addGap(18, 18, 18)
                .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jToggleButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(52, 52, 52))
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel26)
                            .addComponent(jLabel19)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel18)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtfield_caja_editar, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jToggleButton4))))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel27)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel37)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(txtfield_pass_edit, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel36)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(txtfield_tipo_edit, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel24)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(lb_nom_edit))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel15)
                                            .addComponent(jLabel23))
                                        .addGap(18, 18, 18)
                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lb_tipo_edit)
                                            .addComponent(lb_login_edit)))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel32)
                                        .addGap(18, 18, 18)
                                        .addComponent(txtfield_nom_edit, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel20)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(lb_apell_edit))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel16)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(lb_num_id_edit))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel30)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txtfield_apell_edit, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel29)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txtfield_num_id_edit, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
                .addContainerGap(25, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(jLabel19)
                .addGap(15, 15, 15)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(txtfield_caja_editar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jToggleButton4))
                .addGap(18, 18, 18)
                .addComponent(jLabel26)
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(lb_nom_edit)
                    .addComponent(jLabel20)
                    .addComponent(lb_apell_edit))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(lb_login_edit)
                    .addComponent(jLabel16)
                    .addComponent(lb_num_id_edit))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(lb_tipo_edit))
                .addGap(28, 28, 28)
                .addComponent(jLabel27)
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel32)
                    .addComponent(jLabel30)
                    .addComponent(txtfield_nom_edit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtfield_apell_edit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel37)
                    .addComponent(jLabel29)
                    .addComponent(txtfield_num_id_edit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtfield_pass_edit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel36)
                    .addComponent(txtfield_tipo_edit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jToggleButton3)
                    .addComponent(btn_editar)
                    .addComponent(jButton2))
                .addGap(40, 40, 40))
        );

        jTabbedPane1.addTab("Editar Usuario", jPanel4);

        lb_apell_del.setText("--------------------------------------------");

        jLabel33.setText("Tipo:");

        jLabel34.setText("Apellido:");

        lb_tipo_del.setText("--------------------------------------------");

        lb_nom_del.setText("---------------------------------------------");

        jLabel39.setText("Nombre:");

        jLabel40.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel40.setText("Descripcion del Usuario");

        jToggleButton5.setText("Buscar");
        jToggleButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton5ActionPerformed(evt);
            }
        });

        lb_login_del.setText("--------------------------------------------");

        jLabel42.setText("Login:");

        jLabel43.setText("Numero de Identificacion:");

        txtfield_caja_del.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtfield_caja_delActionPerformed(evt);
            }
        });

        lb_num_id_del.setText("--------------------------------------------");

        jLabel45.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        jLabel45.setText("Eliminar Usuairo");

        jLabel46.setText("Digite el Login del Usuario");

        jToggleButton6.setText("Salir");
        jToggleButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton6ActionPerformed(evt);
            }
        });

        btn_eliminar.setText("Eliminar");
        btn_eliminar.setEnabled(false);
        btn_eliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_eliminarActionPerformed(evt);
            }
        });

        jButton5.setText("Cancelar");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel40)
                    .addComponent(jLabel45)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel46)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtfield_caja_del, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jToggleButton5))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(btn_eliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jToggleButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                        .addComponent(jLabel39)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(lb_nom_del))
                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                        .addComponent(jLabel34)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(lb_apell_del))
                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                        .addComponent(jLabel42)
                                        .addGap(18, 18, 18)
                                        .addComponent(lb_login_del))
                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                        .addComponent(jLabel43)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(lb_num_id_del))
                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                        .addComponent(jLabel33)
                                        .addGap(18, 18, 18)
                                        .addComponent(lb_tipo_del)))
                                .addGap(249, 249, 249)))))
                .addContainerGap(67, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addComponent(jLabel45)
                .addGap(15, 15, 15)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel46)
                    .addComponent(txtfield_caja_del, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jToggleButton5))
                .addGap(18, 18, 18)
                .addComponent(jLabel40)
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel39)
                    .addComponent(lb_nom_del))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel34)
                    .addComponent(lb_apell_del))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel42)
                    .addComponent(lb_login_del))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel43)
                    .addComponent(lb_num_id_del))
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(34, 112, Short.MAX_VALUE)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jToggleButton6)
                            .addComponent(btn_eliminar)
                            .addComponent(jButton5))
                        .addGap(69, 69, 69))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel33)
                            .addComponent(lb_tipo_del))
                        .addContainerGap())))
        );

        jTabbedPane1.addTab("Eliminar Usuario", jPanel5);

        jLabel47.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        jLabel47.setText("Eliminar una Lista de Reproduccion");

        jLabel48.setText("Nombre de la lista que quiere eliminar (sin extencion):");

        txtfield_caja_del_lista.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtfield_caja_del_listaActionPerformed(evt);
            }
        });

        btn_eliminar_lista.setText("Eliminar Lista");
        btn_eliminar_lista.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_eliminar_listaActionPerformed(evt);
            }
        });

        jButton4.setText("Cancelar");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton6.setText("Salir");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(btn_eliminar_lista)
                        .addGap(30, 30, 30)
                        .addComponent(jButton4)
                        .addGap(34, 34, 34)
                        .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(txtfield_caja_del_lista, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel47)
                    .addComponent(jLabel48))
                .addContainerGap(315, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(54, 54, 54)
                .addComponent(jLabel47)
                .addGap(26, 26, 26)
                .addComponent(jLabel48)
                .addGap(18, 18, 18)
                .addComponent(txtfield_caja_del_lista, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(48, 48, 48)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_eliminar_lista)
                    .addComponent(jButton4)
                    .addComponent(jButton6))
                .addContainerGap(237, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Elimiar Lista de Reproduccion", jPanel7);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
            .addGroup(layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 503, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 490, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTabbedPane1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane1MouseClicked
        DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();
        int index = modelo.getRowCount();;
        if (index != 0) {
            int j = 0;
            while (index != 0) {
                index = modelo.getRowCount() - 1;
                modelo.removeRow(index);

            }
        }

    }//GEN-LAST:event_jTabbedPane1MouseClicked

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        this.dispose();
        try {
            Login ver = new Login();
            ver.setVisible(true);
        } catch (NotBoundException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (MalformedURLException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (RemoteException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        txtfield_caja_del_lista.setText("");
        txtfield_caja_del_lista.setFocusable(true);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void btn_eliminar_listaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_eliminar_listaActionPerformed

//        System.out.println("--------Elinimacion de una lista---------");
//        System.out.print("Nombre de la lista que quiere eliminar (sin extencion): ");
        String nombre = txtfield_caja_del_lista.getText();
        String[] split = nombre.split("_lista_");
        op = Integer.parseInt(split[1]);
//        System.out.println("login : "+split[0]);
//        System.out.println("numero : "+op);
//        System.out.print("Confirma la eliminacion 1 si   2 no");

        Object[] opciones = {"Si", "No"};
        int n = JOptionPane.showOptionDialog(this, "¿Esta seguro de Eliminar la Lista de Rep.?", "Confirmar", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, opciones, opciones[1]);
        if (n == 0) {
            boolean rl = false;
            try {
                rl = int_canciones.EliminarLista(split[0], op);
            } catch (RemoteException ex) {
                Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
            }
            if (rl) {
                JOptionPane.showMessageDialog(this, "La Lista fue Eliminada ", "Advertencia", JOptionPane.WARNING_MESSAGE);
            } else {
                JOptionPane.showMessageDialog(this, "La Lista No fue Eliminada ", "Advertencia", JOptionPane.WARNING_MESSAGE);
            }

            txtfield_caja_del_lista.setText("");
        } else {
            txtfield_caja_del_lista.setText("");
            txtfield_caja_del_lista.setFocusable(true);
        }


    }//GEN-LAST:event_btn_eliminar_listaActionPerformed

    private void txtfield_caja_del_listaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtfield_caja_del_listaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtfield_caja_del_listaActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        lb_nom_del.setText("--------------");
        lb_apell_del.setText("--------------");
        lb_login_del.setText("--------------");
        lb_num_id_del.setText("--------------");
        lb_tipo_del.setText("--------------");
    }//GEN-LAST:event_jButton5ActionPerformed

    private void btn_eliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_eliminarActionPerformed

        try {
            Object[] opciones = {"Si", "No"};
            int n = JOptionPane.showOptionDialog(this, "¿Esta seguro de Eliminar el Usuario?", "Confirmar", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, opciones, opciones[1]);
            if (n == 0) {
                int_user.Eliminar_Usaurio(login);
                JOptionPane.showMessageDialog(this, "Usuario Eliminado", "Advertencia", JOptionPane.WARNING_MESSAGE);
                lb_nom_del.setText("--------------");
                lb_apell_del.setText("--------------");
                lb_login_del.setText("--------------");
                lb_num_id_del.setText("--------------");
                lb_tipo_del.setText("--------------");
            } else {
                lb_nom_del.setText("--------------");
                lb_apell_del.setText("--------------");
                lb_login_del.setText("--------------");
                lb_num_id_del.setText("--------------");
                lb_tipo_del.setText("--------------");
            }
        } catch (RemoteException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btn_eliminarActionPerformed

    private void jToggleButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton6ActionPerformed

        this.dispose();
        try {
            Login ver = new Login();
            ver.setVisible(true);
        } catch (NotBoundException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (MalformedURLException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (RemoteException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jToggleButton6ActionPerformed

    private void txtfield_caja_delActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtfield_caja_delActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtfield_caja_delActionPerformed

    private void jToggleButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton5ActionPerformed
        try {

            usuario.setLogin(txtfield_caja_del.getText());

            /*
             * Esta es la funcionalidad que valida si el usuario esta registrado
             * y le permite iniciar sesion
             */
            nom = int_user.Obterner_Usuario(usuario).getNombre();          //  |
            apellido = int_user.Obterner_Usuario(usuario).getApellido();   //  |
            login = int_user.Obterner_Usuario(usuario).getLogin();         //  |--> se llama al metodo remoto que 
            num_ide = int_user.Obterner_Usuario(usuario).getNum_Ide();     //  |    obtiene del servidor de usuarios
            pass = int_user.Obterner_Usuario(usuario).getPassword();       //  |    y le asigna a cada variable su
            tipo = int_user.Obterner_Usuario(usuario).getTipo();           //  |    valor.
        } catch (IOException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
//        System.out.println("----------------- Descripcion de Usuario -----------------");
//        System.out.println("//////////////////////////////////////////////");
//        System.out.println("Nombre del Usuario: " + nom);
//        System.out.println("Apellido del Usuario: " + apellido);
//        System.out.println("Login del Usuario: " + login);
//        System.out.println("Numero de Identificacion del Usuario: " + num_ide);
//        System.out.println("Tipo de Usuario: " + tipo);
//        System.out.println("//////////////////////////////////////////////");
//        System.out.println();
        if (nom != null) {
            lb_nom_del.setText(nom);
            lb_apell_del.setText(apellido);
            lb_login_del.setText(login);
            lb_num_id_del.setText(num_ide);
            lb_tipo_del.setText(tipo);
            btn_eliminar.setEnabled(true);
        } else {
            JOptionPane.showMessageDialog(this, "Usuario No Existe ", "Advertencia", JOptionPane.WARNING_MESSAGE);
            txtfield_caja_del.setText("");
            txtfield_caja_del.setFocusable(true);
        }
    }//GEN-LAST:event_jToggleButton5ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        lb_nom_edit.setText("--------------");
        lb_apell_edit.setText("--------------");
        lb_login_edit.setText("--------------");
        lb_num_id_edit.setText("--------------");
        lb_tipo_edit.setText("--------------");
        txtfield_nom_edit.setText("");
        txtfield_apell_edit.setText("");
        txtfield_num_id_edit.setText("");
        txtfield_pass_edit.setText("");
        txtfield_tipo_edit.setText("");
    }//GEN-LAST:event_jButton2ActionPerformed

    private void btn_editarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_editarActionPerformed



        usuario.setNombre(txtfield_nom_edit.getText());
        usuario.setApellido(txtfield_apell_edit.getText());
        usuario.setNum_Ide(txtfield_num_id_edit.getText());
        usuario.setLogin(login);
        usuario.setPasssword(txtfield_pass_edit.getText());
        usuario.setTipo(txtfield_tipo_edit.getText());



        try {
            int_user.Actualizar_Usuario(usuario);
            JOptionPane.showMessageDialog(this, "Usuario Actualizado", "Advertencia", JOptionPane.WARNING_MESSAGE);
            lb_nom_edit.setText("--------------");
            lb_apell_edit.setText("--------------");
            lb_login_edit.setText("--------------");
            lb_num_id_edit.setText("--------------");
            lb_tipo_edit.setText("--------------");
            txtfield_nom_edit.setText("");
            txtfield_apell_edit.setText("");
            txtfield_num_id_edit.setText("");
            txtfield_pass_edit.setText("");
            txtfield_tipo_edit.setText("");

        } catch (RemoteException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btn_editarActionPerformed

    private void txtfield_num_id_editActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtfield_num_id_editActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtfield_num_id_editActionPerformed

    private void jToggleButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton4ActionPerformed
        try {

            usuario.setLogin(txtfield_caja_editar.getText());

            /*
             * Esta es la funcionalidad que valida si el usuario esta registrado
             * y le permite iniciar sesion
             */
            nom = int_user.Obterner_Usuario(usuario).getNombre();          //  |
            apellido = int_user.Obterner_Usuario(usuario).getApellido();   //  |
            login = int_user.Obterner_Usuario(usuario).getLogin();         //  |--> se llama al metodo remoto que 
            num_ide = int_user.Obterner_Usuario(usuario).getNum_Ide();     //  |    obtiene del servidor de usuarios
            pass = int_user.Obterner_Usuario(usuario).getPassword();       //  |    y le asigna a cada variable su
            tipo = int_user.Obterner_Usuario(usuario).getTipo();           //  |    valor.
        } catch (IOException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
//        System.out.println("----------------- Descripcion de Usuario -----------------");
//            System.out.println("//////////////////////////////////////////////");
//            System.out.println("Nombre del Usuario: "+nom);
//            System.out.println("Apellido del Usuario: "+apellido);
//            System.out.println("Login del Usuario: "+login);
//            System.out.println("Numero de Identificacion del Usuario: "+num_ide);
//            System.out.println("Tipo de Usuario: "+tipo);
//            System.out.println("//////////////////////////////////////////////");
//            System.out.println();
        if (nom != null) {
            lb_nom_edit.setText(nom);
            lb_apell_edit.setText(apellido);
            lb_login_edit.setText(login);
            lb_num_id_edit.setText(num_ide);
            lb_tipo_edit.setText(tipo);
            txtfield_nom_edit.setEnabled(true);
            txtfield_apell_edit.setEnabled(true);
            txtfield_num_id_edit.setEnabled(true);
            txtfield_pass_edit.setEnabled(true);
            txtfield_tipo_edit.setEnabled(true);
            btn_editar.setEnabled(true);
        } else {
            JOptionPane.showMessageDialog(this, "Usuario No Existe ", "Advertencia", JOptionPane.WARNING_MESSAGE);
            txtfield_caja_editar.setText("");
            txtfield_caja_editar.setFocusable(true);
        }
    }//GEN-LAST:event_jToggleButton4ActionPerformed

    private void jToggleButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton3ActionPerformed
        this.dispose();
        try {
            Login ver = new Login();
            ver.setVisible(true);
        } catch (NotBoundException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (MalformedURLException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (RemoteException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jToggleButton3ActionPerformed

    private void txtfield_caja_editarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtfield_caja_editarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtfield_caja_editarActionPerformed

    private void jToggleButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton2ActionPerformed
        this.dispose();
        try {
            Login ver = new Login();
            ver.setVisible(true);
        } catch (NotBoundException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (MalformedURLException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (RemoteException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jToggleButton2ActionPerformed

    private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
        //System.out.println("----------------- Buscar de Usuarios -----------------");
        //System.out.println("Login de Usuario : ");
        try {

            usuario.setLogin(txtfield_caja_buscar.getText());

            /*
             * Esta es la funcionalidad que valida si el usuario esta registrado
             * y le permite iniciar sesion
             */
            nom = int_user.Obterner_Usuario(usuario).getNombre();          //  |
            apellido = int_user.Obterner_Usuario(usuario).getApellido();   //  |
            login = int_user.Obterner_Usuario(usuario).getLogin();         //  |--> se llama al metodo remoto que 
            num_ide = int_user.Obterner_Usuario(usuario).getNum_Ide();     //  |    obtiene del servidor de usuarios
            pass = int_user.Obterner_Usuario(usuario).getPassword();       //  |    y le asigna a cada variable su
            tipo = int_user.Obterner_Usuario(usuario).getTipo();           //  |    valor.
        } catch (IOException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
//        System.out.println("----------------- Descripcion de Usuario -----------------");
//        System.out.println("//////////////////////////////////////////////");
//        System.out.println("Nombre del Usuario: " + nom);
//        System.out.println("Apellido del Usuario: " + apellido);
//        System.out.println("Login del Usuario: " + login);
//        System.out.println("Numero de Identificacion del Usuario: " + num_ide);
//        System.out.println("Tipo de Usuario: " + tipo);
//        System.out.println("//////////////////////////////////////////////");
//        System.out.println();
        /*
         * --
         */
        if (nom != null) {
            lb_nom_buscar.setText(nom);
            lb_apell_buscar.setText(apellido);
            lb_login_buscar.setText(login);
            lb_num_id_buscar.setText(num_ide);
            lb_tipo_buscar.setText(tipo);
        } else {
            JOptionPane.showMessageDialog(this, "Usuario No Existe ", "Advertencia", JOptionPane.WARNING_MESSAGE);
            txtfield_caja_buscar.setText("");
            txtfield_caja_buscar.setFocusable(true);
        }



    }//GEN-LAST:event_jToggleButton1ActionPerformed

    private void txtfield_caja_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtfield_caja_buscarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtfield_caja_buscarActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        this.dispose();
        try {
            Login ver = new Login();
            ver.setVisible(true);
        } catch (NotBoundException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (MalformedURLException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (RemoteException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
//     /*   System.out.println("----------------- Listado de Usuarios -----------------");
        ArrayList<Usuario_Impl> listaU = new ArrayList<Usuario_Impl>();
        try {
            listaU = int_user.ListarUsuarios();
        } catch (RemoteException ex) {
            Logger.getLogger(Inter_Admin.class.getName()).log(Level.SEVERE, null, ex);
        }
        DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();


        int i = 0;
        String[] campos = new String[5];
        while (i < listaU.size()) {
//            System.out.println("//////////////////////////////////////////////");
//            System.out.println("Nombre del Usuario: " + listaU.get(i).getNombre());
//            System.out.println("Apellido del Usuario: " + listaU.get(i).getApellido());
//            System.out.println("Login del Usuario: " + listaU.get(i).getLogin());
//            System.out.println("Numero de Identificacion del Usuario: " + listaU.get(i).getNum_Ide());
//            System.out.println("Tipo de Usuario: " + listaU.get(i).getTipo());
//            System.out.println("//////////////////////////////////////////////");
//            System.out.println();



            campos[0] = listaU.get(i).getNombre();
            campos[1] = listaU.get(i).getApellido();
            campos[2] = listaU.get(i).getLogin();
            campos[3] = listaU.get(i).getNum_Ide();
            campos[4] = listaU.get(i).getTipo();
            modelo.addRow(campos);
            i++;

        }


    }//GEN-LAST:event_jButton3ActionPerformed

   
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_editar;
    private javax.swing.JButton btn_eliminar;
    private javax.swing.JButton btn_eliminar_lista;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JToggleButton jToggleButton1;
    private javax.swing.JToggleButton jToggleButton2;
    private javax.swing.JToggleButton jToggleButton3;
    private javax.swing.JToggleButton jToggleButton4;
    private javax.swing.JToggleButton jToggleButton5;
    private javax.swing.JToggleButton jToggleButton6;
    private javax.swing.JLabel lb_apell_buscar;
    private javax.swing.JLabel lb_apell_del;
    private javax.swing.JLabel lb_apell_edit;
    private javax.swing.JLabel lb_login_buscar;
    private javax.swing.JLabel lb_login_del;
    private javax.swing.JLabel lb_login_edit;
    private javax.swing.JLabel lb_nom_buscar;
    private javax.swing.JLabel lb_nom_del;
    private javax.swing.JLabel lb_nom_edit;
    private javax.swing.JLabel lb_num_id_buscar;
    private javax.swing.JLabel lb_num_id_del;
    private javax.swing.JLabel lb_num_id_edit;
    private javax.swing.JLabel lb_tipo_buscar;
    private javax.swing.JLabel lb_tipo_del;
    private javax.swing.JLabel lb_tipo_edit;
    private javax.swing.JTextField txtfield_apell_edit;
    private javax.swing.JTextField txtfield_caja_buscar;
    private javax.swing.JTextField txtfield_caja_del;
    private javax.swing.JTextField txtfield_caja_del_lista;
    private javax.swing.JTextField txtfield_caja_editar;
    private javax.swing.JTextField txtfield_nom_edit;
    private javax.swing.JTextField txtfield_num_id_edit;
    private javax.swing.JTextField txtfield_pass_edit;
    private javax.swing.JTextField txtfield_tipo_edit;
    // End of variables declaration//GEN-END:variables
}
